import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
import { fileURLToPath, URL } from 'node:url'
import babel from "@rollup/plugin-babel";

// https://vitejs.dev/config/
export default defineConfig({
  plugins: [
    react(),
    babel({
      babelHelpers: 'bundled', // 显式配置 babelHelpers 选项  'bundled' 或 'runtime'
      plugins: [
        ["@babel/plugin-proposal-decorators", { "legacy": true }],
        "@babel/plugin-proposal-class-properties",
       // @babel/plugin-transform-private-methods // 需要使用私有属性或者方法 解开
      ]
    })],
  resolve: {
    alias: {
      '~': fileURLToPath(new URL('./src/', import.meta.url))
    }
  }
})
